//
// Created by 陈成 on 2019/9/19.
//

#ifndef RV32I_CPU_INSTI_H
#define RV32I_CPU_INSTI_H

#include "Inst.h"

class InstI : public Inst {
public:
    InstI(uint32_t pc, sc_bv<32> value, RegBank<REG_NUM> *r, RegBank<CSR_NUM> *csr, Mem *m);

    uint32_t
    exec() override;

private:
    sc_bv<12> imm;
    sc_bv< 5> rs1;
    sc_bv< 3> funct3;
    sc_bv< 5> rd;
    sc_bv< 7> opcode;

    void
    handleType0();

    void
    handleType1();

    uint32_t handleType2();

    void handleType3();

    void handleType4();
};


#endif //RV32I_CPU_INSTI_H
